#include "Sir.h"
#include<iostream>

Sir::Sir()
  {
    for(int i = 0;i < max_index; i++)
      {
        std::cout<<"\nv["<<i<<"]=";
	std::cin>>this->v[i];
      }
    this->k = -1;
  }

void Sir::sortare(int left, int right)
  {
    for(int i = left; i < right - 1; i++)
      for(int j = i + 1; j < right; j++)
        if(this->v[i] < this->v[j])
	  {
	    int aux;
	    aux = this->v[i];
	    this->v[i] = this->v[j];
	    this->v[j] = aux;
	  }
  }

void Sir::sortare(int left, int right, int k)
  {
    this->sortare(0, k);
    for(int i = k; i < right - 1; i++)
      for(int j = i + 1; j < right; j++)
        if(this->v[i] > this->v[j])
	  {
	    int aux;
	    aux = this->v[i];
	    this->v[i] = this->v[j];
	    this->v[j] = aux;
	  }
  }

void Sir::afisare()
  {
    std::cout<<"\nSirul:";
    for(int i = 0; i < max_index; i++)
      std::cout<<this->v[i]<<" "; 
    std::cout<<"\n";
  }